package cn.stylefeng.guns.modular.hx.storage.mapper;

import cn.stylefeng.guns.modular.hx.storage.entity.HxStorageCenter;
import cn.stylefeng.guns.modular.hx.storage.model.params.HxStorageCenterParam;
import cn.stylefeng.guns.modular.hx.storage.model.params.HxStorageOutParam;
import cn.stylefeng.guns.modular.hx.storage.model.result.HxStorageCenterResult;
import cn.stylefeng.guns.modular.hx.storage.model.result.HxStorageOutResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 备货区分配 Mapper 接口
 * </p>
 *
 * @author lww
 * @since 2023-10-23
 */
public interface HxStorageCenterMapper extends BaseMapper<HxStorageCenter> {

    /**
     * 获取列表
     *
     * @author lww
     * @Date 2023-10-23
     */
    List<HxStorageCenterResult> customList(@Param("paramCondition") HxStorageCenterParam paramCondition);


    // 查门店
    @Select("select get_unit,get_unit_id from hx_storage_out ")
    List<HxStorageOutResult>  storageunit(@Param("paramCondition") HxStorageOutParam paramCondition);

    //分配给备货口
    @Insert("insert into hx_storage_center(stock_port,get_unit) values(#{stock_port},#{get_unit})")
    int insert(HxStorageCenterParam paramCondition);
//    @Update("update hx_storage_center set get_unit=null")
    int clearall( @Param("paramCondition") HxStorageCenterParam hxStorageCenterParam);
    /**
     * 获取map列表
     *
     * @author lww
     * @Date 2023-10-23
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") HxStorageCenterParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author lww
     * @Date 2023-10-23
     */
    Page<HxStorageCenterResult> customPageList(@Param("page") Page page, @Param("paramCondition") HxStorageCenterParam paramCondition, @Param("condition") String condition);

    Page<HxStorageCenterResult> findHxStorageOutFenpeiBySpec(@Param("page")Page page, @Param("paramCondition")HxStorageOutParam param);

    /**
     * 获取分页map列表
     *
     * @author lww
     * @Date 2023-10-23
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") HxStorageCenterParam paramCondition);


	void updateBySpec(@Param("paramCondition")HxStorageCenterParam hxStorageCenterParam);


    void insertStockPort(@Param("paramCondition")HxStorageCenterParam hxStorageCenterParam);


}
